import random
you_win = 0
pc_win = 0
while you_win<2 and  pc_win<2:
    type = random.randint(0,2)
    user_type = eval(input("请出：(0:剪刀，1:石头，2:布)"))
    if type == user_type:
        print("电脑出",("剪刀" if type==0 else "石头" if type==1 else "布")," 你出",("剪刀" if user_type==0 else "石头" if user_type==1 else "布"),"平")
    elif (user_type==1 and type == 0) or (user_type==2 and type == 1) or (user_type==0 and type==2):
        you_win += 1
        print("电脑出", ("剪刀" if type==0 else "石头" if type==1 else "布")," 你出", ("剪刀" if user_type==0 else "石头" if user_type==1 else "布"), "赢")
    else:
        pc_win += 1
        print("电脑出",("剪刀" if type==0 else "石头" if type==1 else "布")," 你出",("剪刀" if user_type==0 else "石头" if user_type==1 else "布"),"输")

if pc_win>=2:
    print("电脑胜出")

if you_win>=2:
    print("你胜出")